package com.yzd.learnjava.innerclasses.controller;

import com.yzd.learnjava.util.Print;

public abstract class Event {
	protected long eventtime;
	protected final long delaytime;
	public Event(long delaytime) {
		this.delaytime = delaytime;
		start();
	}
	public void start() {
		eventtime = System.currentTimeMillis() + delaytime;
	}
	
	public boolean ready() {
		//Print.print("time : " + System.nanoTime() + ", eventtime : " + eventtime +  ",name : " + getClass().getSimpleName());
		return System.currentTimeMillis() == eventtime;
	}
	
	public abstract void action();
}
